using System;
using System.Runtime.Serialization;

namespace CoreLibrary.Messaging.Sql {

    [DataContract]
    public class ListMessageQuery {

        private int _offset;
        private int _limit;

        public ListMessageQuery() {
            MessageStatuses = new int[0];
        }

        [DataMember]
        public int[] MessageStatuses { get; set; }

        [DataMember]
        public long? ScheduledDateFrom { get; set; }

        [DataMember]
        public long? ScheduledDateTo { get; set; }

        [DataMember]
        public bool Asc { get; set; }

        [DataMember]
        public int Offset {
            get { return _offset; }
            set { _offset = Math.Max(0, value); }
        }

        [DataMember]
        public int Limit {
            get { return _limit; }
            set { _limit = Math.Max(0, value); }
        }
     
    }
}